package com.huyanqi.front.rest.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.huyanqi.core.RetdCodeType;
import com.huyanqi.core.RetdObj;
import com.huyanqi.core.service.impl.BaseFrontServiceImpl;
import com.huyanqi.dao.ShopactivityDAO;
import com.huyanqi.entity.Shopactivity;
import com.huyanqi.front.rest.service.ShopactivityRestService;

@Service("ShopactivityRestService")
public class ShopactivityRestImpl extends BaseFrontServiceImpl<Shopactivity,Long, ShopactivityDAO> implements ShopactivityRestService{

	@Override
	@Resource(name="ShopactivityDAO")
	public void setEntityDao(ShopactivityDAO entityDao) {
		this.entityDao=entityDao;
	}
	
	@Override
	public RetdObj<List<Shopactivity>> findShopActivityBySid(Long shopid) {
		RetdObj<List<Shopactivity>> retd = new RetdObj<List<Shopactivity>>();
		List<Shopactivity> list = entityDao.executeQuery("FROM Shopactivity WHERE aShop = ?", shopid);
		if(list!=null){
			retd.setRealObj(list);
			retd.setCode(RetdCodeType.PASS_OK);
		}else{
			retd.setCode(RetdCodeType.PASS_NODATA);
		}
		return retd;
	}
	
}
